<?php
// +----------------------------------------------------------------------
// | wttai [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.wttai.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: huajie <laoshiji@wttai.com>
// +----------------------------------------------------------------------

namespace Admin\Model;
use Think\Model;

/**
 * 站点模型
 * @author huajie <laoshiji@wttai.com>
 */

class SiteModel extends Model {
    
    /* 自动验证规则 */
    protected $_validate = array(
        array('domain', '', '域名必须唯一，站点才能查找', self::MUST_VALIDATE, 'unique', self::MODEL_BOTH),
    );
    
    /* 自动验证规则 */
    protected $_auto = array(
        
    );
    
    /**
     * 重写模型的自动验证
     * 
     * @param type $data 数据
     * @param type $type 类型
     * 
     * @return type
     * 
     */
    public function create($data='',$type='')
    {
        $this->validate($this->_validate)->auto($this->_auto);
        return parent::create($data, $type);
    }  
}
